package cn.config;
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.stereotype.Component;

/**
* @Author zhanghao
* @Description //接收特殊字符
* @Date  2021/3/19
* @Param
* @return
**/

@Component
class CustomContainer implements WebServerFactoryCustomizer<TomcatServletWebServerFactory> {

    @Override
    public void customize(TomcatServletWebServerFactory factory) {
        factory.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> {
            connector.setAttribute("relaxedQueryChars", "<>[\\\\]^`{|}");
            connector.setAttribute("relaxedPathChars", "<>[\\\\]^`{|}");
        });
    }
}
